<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><?php echo (L("_VIEW_WAVEFORM")); ?></title>
<style>
.page div{height:30px;line-height:30px;text-align:center;}
.page a{padding:5px 8px;}
.page span{padding:5px 8px;color:red;}
.page font{padding:5px 8px;}
</style>
<script type="text/javascript" src="<?php echo C('HOME_JS');?>echarts.js"></script>
<script>
function view_img1(key,title,num_x,num_y){
	var myChart = echarts.init(document.getElementById(key));
	option = {
		    tooltip: {trigger: 'axis'},
		    legend: JSON.parse(title),
		    grid: {left: '10%',right: '5%',bottom: '7%',top:'5%',containLabel: true },
		    xAxis: {type: 'category',boundaryGap: false,data: JSON.parse(num_x)},
		    yAxis: { type: 'value'},
		    dataZoom:[{type:'slider',start:'0',end:'20',bottom:'0px'}],
		    series: JSON.parse(num_y)
		};
	myChart.setOption(option);
}
/* function view_img2(key,title,num_x,num_y,max,min){
	var myChart = echarts.init(document.getElementById(key));
	option = {
		    tooltip: {trigger: 'axis'},
		    legend: JSON.parse(title),
		    grid: {left: '14%',right: '5%',bottom: '15%',top:'5%',containLabel: true },
		    xAxis: {type: 'category',boundaryGap: false,data: JSON.parse(num_x)},
		    yAxis: { type: 'value',max:max,min:min},
		    dataZoom:[{type:'slider',start:'0',end:'20',bottom:'0px'}],
		    series: JSON.parse(num_y)
		};
	myChart.setOption(option);
} */
</script>
</head>
<body>
<?php if(empty($res)): ?><div style='height:100px;line-height:100px;text-align:center;color:red;'><?php echo (L("WAVE_INTRO")); ?></div>
<?php else: ?>
	<?php if(is_array($res)): $i = 0; $__LIST__ = $res;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div>
		<div style="width:100%;background:gray;color:white;padding:5px;height:30x;line-height:30px;">
		<font style="font-size:18px;font-weight:bold"><?php echo (L("_EEG_VAVEFORM_IMG")); ?></font>
		<?php echo (L("_UPLOAD_TIME")); ?>：<?php echo (date('Y-m-d H:i:s',$res["$key"]["time"])); ?>
		</div>
		<div>【<?php echo (L("WAVE_MUSICNAME")); ?>：<?php echo ($vo["music_info"]["scene"]); ?>】【<?php echo (L("WAVE_INSTRUMENT")); ?>：<?php echo ($vo["music_info"]["instrument"]); ?>】 【<?php echo (L("WAVE_ENTERTIME")); ?>：<?php echo ($vo["music_info"]["entertime"]); ?>】【<?php echo (L("WAVE_OUTTIME")); ?>：<?php echo ($vo["music_info"]["outtime"]); ?>】</div>
		     
	</div>
	<div id="main1<?php echo ($key); ?>" style="width: 900px;height:430px;"></div>
	 <!-- <div id="main2<?php echo ($key); ?>" style="width: 900px;height:200px;"></div>  -->
	<script>
	view_img1('main1<?php echo ($key); ?>','<?php echo ($vo["title1"]); ?>','<?php echo ($vo["num_x1"]); ?>','<?php echo ($vo["arr_y1"]); ?>');
	/* view_img2('main2<?php echo ($key); ?>','<?php echo ($vo["title2"]); ?>','<?php echo ($vo["num_x2"]); ?>','<?php echo ($vo["arr_y2"]); ?>','100','-100'); */
	</script><?php endforeach; endif; else: echo "" ;endif; ?>
	<div class="page"><?php echo ($page); ?></div><?php endif; ?>
</body>
</html>